﻿using Core.DomainServices;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HtmlAgilityPack;
using Core.Domain;

namespace Infrastructure.DomainServices
{

    public sealed class DataRepository : IDataRepository
    {

        private readonly ILoggerService logger;

        public DataRepository(ILoggerService logger)
        {
            this.logger = logger;
        }

        public IList<Core.Domain.FileInfo> GetFiles(string workingfolder)
        {
            var items = new List<Core.Domain.FileInfo>();
            foreach (string file in Directory.EnumerateFiles(workingfolder, "*.xml"))
            {
                items.Add(new Core.Domain.FileInfo { Path = file, FileName = Path.GetFileName(file) });
            }
            return items;
        }

    }
}
